package synapses;

import neurons.NeuronInterface;
import signal.SignalInterface;

public class NormalSynapseToNeuron extends SynapseAbstract {

	private NeuronInterface neuronOut;
	private double weight;

	// private SynapseInterface synapseIn;

	public NormalSynapseToNeuron(NeuronInterface neuron) {
		neuron.growIncomingSynapse(this);
		this.neuronOut = neuron;
		weight = Math.random();
		charged = false;
	}

	// public void setSynapseIn(SynapseInterface synapse) {
	// synapseIn = synapse;
	// }

	@Override
	public void transmit(SignalInterface whatIDeliver) {
		data = whatIDeliver.getData();
		charged = true;
		System.out.println(toString() + " stocking :" + whatIDeliver.getData());
		if (neuronOut != null) {
			neuronOut.aSynapseHasBeenCharged(this);
		}
	}

	@Override
	public Double getWeight() {

		return weight;
	}

}
